const express = require('express');
const router = express.Router();
const db = require('../config/db')

const obj = { name: '图雀社区', website: 'https://tuture.co' }
router.get('/', (req, res) => {
  const sql = "select * from blogs where bid = 1"
  
  db.query(sql,(err,rows)=>{
    if(err){
      res.json({err:"chucuole"})
    }
    else{
      res.json({list:rows})
    }
  })
  // res.json({data:sql });
  // res.send(obj);

});

router.get('/contact', (req, res) => {
  res.send('contact');
});

module.exports = router;
